<?php

use yii\db\Migration;

class m170622_075357_create_spread_info extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=MyISAM';
        }

        $this->createTable('{{%spread_info}}', [
            'id' => $this->primaryKey()->unsigned()->comment('自增id'),
            'guild_sign' => $this->string(50)->comment('所属公会标识'),
            'spread_key_1' => $this->string(50)->comment('推广类型'),
            'spread_key_2' => $this->string(50)->comment('所属员工'),
            'spread_url' => $this->string(1000)->comment('推广链接'),
            'spread_surl' => $this->string(1000)->comment('短链接'),
            'game_id' => $this->integer(32)->comment('游戏ID'),
            'server_id' => $this->integer(32)->comment('区服ID'),
        ], $tableOptions);
    }

    public function down()
    {
        $this->dropTable('{{%spread_info}}');
    }
}
